<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <table >
        <tr>
            <td>
                <input type="text" id="ip" name="ip" style="width: 300px;" placeholder="服务器ip">
            </td>
        </tr>
        <tr>
            <td>
                <input type="text" id="ywPort" name="ywPort" style="width: 300px;" placeholder="服务器端口">
            </td>
        </tr>
        <tr>
            <td>
                <input type="text" id="ctx" name="ctx" style="width: 300px;" placeholder="工程名字">
            </td>
        </tr>
        <tr>
            <td>
                <input type="button"  style="width: 300px;" value="提交" onclick="tj()">

            </td>
        </tr>
    </table>
</body>

<script>
    function tj() {
        var val=document.getElementById("ip").value;
        var ywPortVal=document.getElementById("ywPort").value;
        var ctxVal=document.getElementById("ctx").value;
        var obj = new Object();
        obj.ip = val;
        obj.ywPort = ywPortVal;
        obj.ctx = ctxVal;
        var objVal = JSON.stringify(obj);
        hjJavaObject.alert(objVal);
    }
</script>
</html>